package com.example.cv.service.iml;

import com.example.cv.mapper.EmployeeMapper;
import com.example.cv.model.ACEmployee;
import com.example.cv.model.Candidate;
import com.example.cv.model.Employee;
import com.example.cv.model.Employer;
import com.example.cv.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImpl implements EmployeeService {
    public EmployeeMapper employeeMapper;

    @Autowired
    public void setEmployeeDao(EmployeeMapper employeeMapper) {
        this.employeeMapper=employeeMapper;
    }

    @Override
    public boolean addEmployee(int c_id, int e_id) {
        return employeeMapper.addEmployee(c_id,e_id);
    }

    @Override
    public List<Employer> findEmployersInEmployeesByCId(int c_id) {
        return employeeMapper.findEmployersInEmployeesByCId(c_id);
    }

    @Override
    public Employee findEmployeesByIds(int c_id, int e_id) {
        return employeeMapper.findEmployeesByIds(c_id,e_id);
    }

    @Override
    public boolean informCV(int c_id, int e_id,int cv_isAgree) {
        return employeeMapper.informCV(c_id,e_id,cv_isAgree);
    }

    @Override
    public List<Candidate> findCandidatesInEmployeesByEId(int e_id) {
        return employeeMapper.findCandidatesInEmployeesByEId(e_id);
    }

    @Override
    public boolean informInterview(int c_id, int e_id, int interview_isAgree) {
        return employeeMapper.informInterview(c_id,e_id,interview_isAgree);
    }

    @Override
    public List<Employee> findEmployeesByEId(int e_id) {
        return employeeMapper.findEmployeesByEId(e_id);
    }

    @Override
    public List<Employee> findEmployeesByCId(int c_id) {
        return employeeMapper.findEmployeesByCId(c_id);
    }

    @Override
    public List<Candidate> findAllAcceptedCandidatesByEId(int e_id) {
        return employeeMapper.findAllAcceptedCandidatesByEId(e_id);
    }

    @Override
    public List<ACEmployee> findAcceptedCandidatesByParams(String school,String e_name) {
        return employeeMapper.findAcceptedCandidatesByParams(school,e_name);
    }

    @Override
    public boolean addACEmployeeByIds(int c_id, int e_id) {
        return employeeMapper.addACEmployeeByIds(c_id,e_id);
    }
}
